package com.weipai.springboot.module.dao.impl;

import com.weipai.springboot.model.Inventory;
import com.weipai.springboot.module.dao.InventoryDao;
import com.weipai.springboot.module.mapper.InventoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @Author: 曹朋飞
 * @Date: 2018/08/23 09:38
 */
@Repository
public class InventoryDaoImpl implements InventoryDao{
    
    @Autowired
    private InventoryMapper inventoryMapper;
    
    @Override
    public Map<String, Object> getStorageGoodsNum(String storageId, String skuNumber) {
        return inventoryMapper.getStorageGoodsNum(storageId, skuNumber);
    }

    @Override
    public int insert(Inventory inventory) {
        return inventoryMapper.insert(inventory);
    }

    @Override
    public int updateGoodsNumber(String inventoryId, int allNum) {
        return inventoryMapper.updateGoodsNumber(inventoryId, allNum);
    }

    @Override
    public Inventory selectByPrimaryKey(Long inventoryId) {
        return inventoryMapper.selectByPrimaryKey(inventoryId);
    }

    @Override
    public int updateByPrimaryKeySelective(Inventory inventory) {
        return inventoryMapper.updateByPrimaryKeySelective(inventory);
    }
}
